<f:view xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui"
	xmlns:pm="http://primefaces.org/mobile" contentType="text/html" renderKitId="PRIMEFACES_MOBILE">

	<pm:page title="Sipariş">
		<pm:view id="main">
			<f:facet name="header">
				<h:outputText value="Order Sheet" />
			</f:facet>
			<pm:header title="#{cWaiterForm.selectedTable.name}" swatch="b">
				<f:facet name="left">
					<p:commandLink value="Back" icon="back" action="#{cWaiterAction.goBack()}" />
				</f:facet>

				<f:facet name="right">
					<p:commandLink value="Logout" icon="back" action="#{cWaiterAction.logout()}" />
				</f:facet>
			</pm:header>
			<pm:content>
				<h:form id="myForm">
					<p:dataList value="#{cWaiterForm.ordersForTable}" var="myOrder" type="inset">
						<f:facet name="header">
							<h:outputText value="Orders" />
						</f:facet>
						<h:panelGrid columns="3">
							<h:outputText value="#{myOrder.id}" />
							<h:outputText value="#{myOrder.eFood.name}" />
							<p:commandLink value="Show Details" action="#{cWaiterAction.navigateToFoodDetails(myOrder)}" />
						</h:panelGrid>
					</p:dataList>

					<p:commandButton value="Get Summary" action="#{cWaiterAction.navigateToSummary()}" />

					<p:panel header="New Order" collapsed="true">
						<pm:field>
							<h:outputLabel value="Foods: " for="foods" />
							<h:selectOneMenu value="#{cWaiterForm.selectedFood}" id="foods">
								<f:selectItems value="#{cWaiterForm.foodSelectItems}" />
							</h:selectOneMenu>
						</pm:field>
						<p:inputTextarea id="inputTextarea" label="Description:" value="#{cWaiterForm.description}" />
						<p:commandButton value="Add" action="#{cWaiterAction.addFood()}" update="myForm" />
					</p:panel>
				</h:form>
			</pm:content>
		</pm:view>
	</pm:page>
</f:view>